Index
Windows NT DOS Drive Remapper Service

The Disk Administrator program that comes with Windows NT® allows you to change the DOS drive letters assigned to disk drives.  However, it doesn't allow you to [re]assign the drive letters for other types of drives.

If, for example, you have two hard drives and one CD ROM drive, the CD ROM drive will always be assigned the first available drive letter after drive letters have been assigned to the hard drive partitions.  If each hard drive has a single partition, then they will be assigned drive letters C: and D:, and the CDROM will be assigned E:.  You have no choice over this.  If you'd like to have the CDROM be on drive F: so that you can connect to a network drive as E:, you're out of luck.

The Windows NT DOS Drive Remapper Service (DrMapSvc) allows you to have some control over the assignment of drive letters.  As its name implies, it is also a "service".  In other words, it is installed as a Windows NT service and can be started, stopped, paused, and resumed just like other NT services.  The primary advantage of this approach is that DrMapSvc can be configured to automatically start when NT boots and perform the drive letter remapping then.  Therefore, when you later log on to a NT userid, the drive mappings will already be in effect.

The DrMapSvc Setup  program allows you to Install, Configure, and Uninstall the DrMapSvc program.  These operations are performed by selection of the following three buttons on the main Setup screen:

Install

Configure

Uninstall

The DrMapSvc install program also installs a utility program that can be used to remap drive letters from the command line or to interactively remap drive letters.  More information on this program, DrvReMap, can be obtained by selecting the following topic:

DrReMap

This program is distributed "as is".  While the author has tested the program and believes it to perform as documented herein, no warranty is expressed or implied.  The author assumes no liability for any damages that may be a result of using this program.

Shareware Notice

This application is distributed as "shareware".  That means you can try it out for free.  If, after using it for thirty days, you decide to keep you, you should pay the author a small fee in order to continue using DrMapSvc.  This fee is US$15.00.  Please send a check to:

Sheldon Fox

Fox Consulting Services

P.O. Box 955

El Granada, CA    94018

       USA

Tel:  1-415-712-8369

Fax: 1-415-726-3357

If you include your Compuserve user id or Internet address with your payment, you will automatically be notified of any future updates to the program.

This license fee will entitle you to continue using DrMapSvc on one system after the initial 30 day evaluation period.   If you wish to install DrMapSvc on multiple systems, multiple license fees are required.  Permission is granted, however, to install DrMapSvc on two systems provided you are the principle user of both of those systems (your "office" and "home" computers, for example).

Acknowledgements


 Installation

The Install button on the main setup screen brings up the Install screen, which allows you to perform the following functions:

1)	Copies the application files from the installation disk/directory to your hard drive.

2)	Creates a NT Service called DriveRemapper.

3)	Registers DrMapSvc as an EventLog message file.

4)	Copies the DrvReMap command line utility to the installation directory. (See the DrvReMap topic for more information.)

5)	Automatically takes you to the Configure screen so you can configure the drives DrMapSvc is to process.

These steps are performed when you click on the Install button.

While is isn't necessary to know the following information to use DrMapSvc, some may find the information useful so that they know exactly what changes the Install process makes to your system and how the DrMapSvc program operates.

Registry Modifications

The DriveReMapper service is created using the NT CreateService() API.  This causes the following key to be added to the registry in HKEY_LOCAL_MACHINE:

System\CurrentControlSet\Services\DriveRemapper

In addition to the values for a normal NT service, an additional value named Mappings is added to this key to hold the drive letters that are to be remapped.  This value can be REG_SZ if a single drive is to be mapped or REG_MULTI_SZ if multiple drives are to be remapped.  (See the Configure topic for an explanation of the format of the strings in the Mappings value.)

Furthermore, the following new key is added to the registry in HKEY_LOCAL_MACHINE:

System\CurrentControlSet\Services\EventLog\Application\DriveRemapper

This entry is needed so that the EventLog application can format and display the entries DrMapSvc adds to the Application Event Log.

After making these registrry changes, the DrMapSvc application is fully integrated into the NT Service Manager.  It can be manipulated using the Services applet in the Control Panel) and the NT EventLog (in the Applications Log, just like any other NT service.

Operation

NT Services don't have much choice as to how to present feedback as to what they are doing or to in how they notify you if they have problems.  The NT Event Log is about the only way that they can provide feedback.  Therefore, the DrMapSvc will produce one event log entry for each "o: n:" line it finds in the Mappings registry entry (or an error message if it is unable to access the Mappings key).

If the remapping for a given entry was performed successfully, an Informational entry is added to the Application Event Log.  (If you don't see it, check to make sure that the DriveRemapper service is set to "Automatic" startup and that you're looking at the Application, not System or Security log in the Event Viewer).  This entry will indicate that the remapping for the specified drive was performed.

If the Mapping entry could not be processed for some reason, an Error entry is added to the Application Event log.  This message will indicate that there was a syntax error (review step 7 if you get this message), that the o: drive isn't already defined, that the n: drive is already defined, or that NT was unable to perform the remapping as requested.

Once the DrMapSvc service has started (either automatically at NT boot time, or by selecting the Start button in the Service Manager applet), it checks the entries in the Mappings key and performs the requested mapping.  It will then enter automatically place itself in the Paused state.

If you want to change the drive remappings and have them processed without having to reboot, you can use the Setup Configure function (or, if you're familiar with the NT registery editor, RegEdt32, edit the Mappings key value in the registry directly) and then select the Continue button in the Service Manager applet.  This will cause DrMapSvc to rescan the Mappings key and process all the remapping entries it contains.  The results of this remapping are presented in the Application Event Log as noted above.


Configure

The Configure button on the main Setup screen takes you to the Configure Screen which allows you to define the drive letters that are to be remapped using DrMapSvc.

To specify the drive to be remapped, you need to enter the old (existing) drive letter and the new (remapped) drive letter in the New Entry text box.  You can provide one or mappings, but each must be added separately.

Each remapping entry is of form:

o: n: [devicename] [;comment]

The o: portion is the old (existing drive letter).   The n: portion is the new drive letter to which "o:" is changed.  For example, if you want to remap your E: drive to be your F: drive (and E: becomes undefined), then enter "E: F" for the "o: n:" portion of the entry.

The optional devicename field allows for additional verification that you're mapping the proper drive.  If this field is present, DrMapSvc will not perform the drive remapping for this entry unless the current device assignment of drive o: is devicename.

The colon (":") must be in the is required following drive letters.  The o: drive must be defined at the time the DrMapSvc program processes this entry (typically at NT boot time).  The n: drive must NOT be defined at the time the entry is processed.

Drive letters can be entered as either upper or lower case, or mixed case letters.  A semicolon begins a comment.  It is also possible to add an entry that consists solely of a comment.

Once the drive designations are correctly entered in the New Entry text box, click on the Add New Entry button.  If an entry in the remapping strings list box is selected, the new entry is added before the selected entry.  If no entry is selected, then the entry is added to the end of the list.

DrMapSvc processes the drive remappings in the order they appear in the list box.  Given that ordering is important (e.g., you my remap a drive to a new letter so that you can reuse that letter for another device), you can select an entry in the list box and click on Move Entry Up or Move Entry Down buttons to achieve the desired ordering.

An existing entry can be removed by selecting it in the list box and then clicking on the Remove Entry button.  The entry is placed in the New Entry text box so that you can change it and re-add it (or easily recover it if you change your mind about deleting it).

The Show Definition button will display the NT device name that is currently assigned to the highlighted entry in the list box.

If you want the Drive Remapper service to start each time NT boots, check the Automatically start the drive Remapper Service at boot time check box.  Then the next time you reboot, the Drive Remapper program is automatically started and the drive remappings in the Mappings key are processed.

After the desired remapping entries have be created, click on the Configure button.  Note that the remappings are not actually performed until you reboot your system.  (See the Installation section for more information about when and how the DrMapSvc executes.)

For an example, assume your CDROM is drive E: and you want to map it to drive F:, but you don't want the mapping performed if for some reason E: is not currently assigned to the CDROM device (which might happen if you changed the hardware configuration of your system but forgot to update the drive mapping list), you would create an entry of the form:

E: F: \Device\CDROM0   ; Move CD ROM to drive F:

As another example, if you want to swap the definitions of two drives, you need to use a "temporary" drive letter.  For example, to swap G: and H:, set the Mappings value to be REG_MULTI_SZ, and enter the following three lines (one at a time) in the New Entry text box (assuming drive X: is not assigned to any other device):

G: X:  ;Temporarily assign drive G: to be X: to free up "G:"

H: G:  ;Now remap H: to be G:

X: H:  ;Finally, rename X: (the origional G:) to H:


Uninstall

The Uninstall button on the main Setup screen brings you to the Uninstall screen which allows you to remove the DrMapSvc from your system.  Selecting the Uninstall button on this screen causes steps 2 and 3 listed in the Install section to be undone.   In other words, the DriveRemapper service is deleted and all the DrMapSvc registry entries are removed.

Note that the DrMapSvc files are not removed from the installation directory.  This allows you to easily reinstall the program by rerunning the Setup application.  You can, of course, entirely remove this directory and it contents if you no longer want to keep DrMapSvc on your disk.


DrReMap Command Line Utility
DrvReMap Command Line Utility

Since it is also sometimes convenient to do some temporary drive remappings (instead of having a service perform the remappings at NT boot time),  a command line program is included to perform this function.  The command is called DrvReMap.  It accepts two parameters, the old (existing) and new drive letters.

To use DrvReMap to remap, for example, drive E: to be drive F:, enter the following command:

drvremap e: f:

This will make the device currently defined as E: become the F: drive (and E: becomes undefined).  This mapping will remain in effect until you next reboot NT.

Note that you'll need to force any open FileManager instances to "refresh" (F5) in order to see the new drive mappings.

If you instead invoke DrvReMap without any parameters (or with invalid parameters), it will bring up a dialog box that shows you all your current drive mappings.  You can then interactively select a drive from the list shown and remap it to another drive letter.


Acknowledgements
Acknowledgments

I came across the need for this program when I was reorganizing my two systems, both having two IDE drives and one CDROM drive, and one of the two with a 1G SCSI drive that I wanted to share with the other system.  The two IDE drives were of course assigned the drive letters C: and D: by NT.  However, the SCSI drive was E: on the system to which it was attached and the CDROM was F:, but the CDROM on the other system (without the SCSI drive) was assigned the letter E:.  This of course precluded me from connecting to the SCSI drive over the NET as the E: drive.

I couldn't find any way around this until I head of a shareware program written by Reinhold Gerharz which performed a similar function to the command line program DrvReMap described above.  However, as a command line utility, it didn't allow me to do the drive remapping before logging on, thereby preventing me from using NT's auto reconnect facility to connect the SCSI drive as E: on the second system.

It did, however, provide me with the motivation to figure out how to do drive remapping and to then write a program that would perform remapping as a NT service.

Also many thanks to Bob Chronister for his comments and encouragement to get the code in shape to distribute.

Copyright© Fox Consulting Services, 1994

All Rights Reserved

For Help on Help, Press F1